package com.xyht.sca_s.student_manage_system.modules.card.controller;


import com.xyht.sca_s.student_manage_system.auth.util.JwtTokenUtil;
import com.xyht.sca_s.student_manage_system.common.commonReturn.ResponseResult;
import com.xyht.sca_s.student_manage_system.common.desEncodeAndDecode.annotation.SecretBody;
import com.xyht.sca_s.student_manage_system.modules.card.entity.req.SmsCardAddReq;
import com.xyht.sca_s.student_manage_system.modules.card.service.SmsCardService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author XYHT
 * @since 2023-01-20
 */
@RestController
@RequestMapping("/card")
@SecretBody
public class SmsCardController {
    @Autowired
    SmsCardService smsCardService;
    @Autowired
    private JwtTokenUtil jwtTokenUtil;

    //申请补办
    @ApiModelProperty(value = "证件补办申请")
    @PostMapping("/student/add")
    public ResponseResult addLeaveProcess(@RequestBody SmsCardAddReq smsCardAddReq, HttpServletRequest request) {
        String user_id = jwtTokenUtil.getUserIdByRequest(request);
        return smsCardService.addCard(smsCardAddReq, user_id);
    }

    //查看补办记录列表
}

